﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace CSharpProj.MyExpression
{
    /// <summary>
    /// 表达式-数据库表
    /// </summary>
    public class TableExpression : QueryExpression
    {
        /// <summary>
        /// 初始化一个表示数据库表引用的表达式
        /// </summary>
        /// <param name="type">表内元素的类型(对应实体类)</param>
        /// <param name="alias">表的别名</param>
        /// <param name="name">表的名称</param>
        public TableExpression(Type type, string alias, string name)
            : base((ExpressionType)DbExpressionType.Table, type)
        {
            ElementType = type;
            Alias = alias;
            Name = name;
        }

        /// <summary>
        /// 表的名称
        /// </summary>
        public string Name { get; set; }

        public override DbExpressionType ExpressionType { get { return DbExpressionType.Table; } }

    }
}
